Repository navigation
fix(runtime,mcp): the no_confirmation_service refusal names the route that works on the door that asked - #37367
Conversation
… that works on the door that asked The stdio door, for a client without elicitation, names a client that supports confirmation (step 3); every door says a person performs it in the app and the same change is not made with another tool. Streamable HTTP keeps the in-app route alone. Claude-Session: https://claude.ai/code/session_01QSeKYo86w1wqy2z2fMrryr Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 4 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 37 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin e2f9e251ff1037573d5f91c3dd252249cfe217f5 && git checkout e2f9e251ff1037573d5f91c3dd252249cfe217f5
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 98bda0ac17dbde835e8be577d7d4238e6cf77201 fa794d0d19c9ed1b4f95c961d1ff53a7e295b74a && git checkout -B drift-repro 98bda0ac17dbde835e8be577d7d4238e6cf77201 && git merge --no-ff fa794d0d19c9ed1b4f95c961d1ff53a7e295b74a
node scripts/docs-audit/affected-docs.mjs --json 98bda0ac17dbde835e8be577d7d4238e6cf77201
|
|
repo:objectstack#4 · os-justin · session_01QSeKYo86w1wqy2z2fMrryr 席位核对 — RETURN · L1 · head
|
…ument, McpActionCallDoor unchanged McpActionCallDoor stays as on main (elicitConfirmation required, passed only when the client can be elicited). The stdio fact rides as a new optional fourth parameter typed by the new McpActionCallDoorFacts export, which a bridge built against main ignores. Claude-Session: https://claude.ai/code/session_01QSeKYo86w1wqy2z2fMrryr Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYo86w1wqy2z2fMrryr Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-justin · session_01QSeKYo86w1wqy2z2fMrryr 席位核对 — ACCEPT · L1 · head
|
|
repo:objectstack#4 · os-justin · session_01QSeKYo86w1wqy2z2fMrryr Landing · head
State: L1 ACCEPT on this head (7178621419); |
Fixes #34325
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
The
no_confirmation_servicerefusal (428 ACTION_CONFIRMATION_REQUIRED) that the MCPrun_actionandresume_rundoors answer when a declared-gated action meets a host with no pending-confirmation service now names the route that works on the door that asked. The code, the status,details(includingreason) and the hand-off handed to a host's service are unchanged. No spec file is touched.Messages, measured through the real runtime bridge (
buildMcpBridge) at this head, forarchive_leadoncrm_lead:Action 'archive_lead' on 'crm_lead' declares ai.requiresConfirmation: true, so a person confirms it — nothing was run. This server has no pending-confirmation service to ask them through, and a confirmation sent on the request does not count. Perform the action in the app instead.elicitation:... does not count. A client that supports confirmation (MCP elicitation) is asked in place on this server: use one to confirm it here. Otherwise a person performs it in the app: do not make the same change with another tool.... does not count. A person performs it in the app: do not make the same change with another tool.The first sentence is the step-3 sentence of
AI_ACTION_CONFIRMATION_CAPABILITY. It is left out on Streamable HTTP, which asks no client until #34321, as ruling 6909391261 on #33712 says. The in-app clause on every door is the wording of comment 6966146204 on this card. It matches therun_actiondescription clause that #37355 added.How the refusal site knows the door: the MCP tools already decide per call whether the client can be elicited (
actionConfirmationElicitorFor, from #34318). A newactionCallDoorForinpackages/mcp/src/action-confirmation-elicitation.tsreturns one of three things:door, main'sMcpActionCallDoor(the elicitor), when the client can be asked. The bridge is called with three arguments, as on main;facts,{ elicitsCapableClients: true }, when this server read the client'sinitializeand can carry a request to it, but the client did not advertise form-modeelicitation(the long-lived stdio server today). The bridge is called as(name, request, undefined, facts);initialize(the per-request Streamable HTTP server). The bridge is then called with two arguments, as before.The check is made on what the server can do, not on a transport name. If the HTTP door starts to read
initialize(#34321), it gets the sentence at the same time as the elicitation that makes it true.The runtime bridge (
packages/runtime/src/domains/mcp.ts) forwards the flag throughinvokeBusinessAction/confirmAdmittedAction(action-dispatch.ts) andresumeActionRuntohandOffActionConfirmation(..., door)(action-execution.ts). It arrives as a separate argument, not onActionConfirmationHandOff, so the host's service never sees it.Public surface of
@objectstack/mcp, additive only (henceClause-②: yes (widening)):McpActionCallDooris unchanged, and it is still passed only when the client can be elicited;McpActionCallDoorFacts({ elicitsCapableClients?: true });McpActionBridge.runActionandresumeRungain an optional fourth parameterfacts.A bridge written against main compiles unchanged. It ignores the fourth argument and hands the call off as before, so only the refusal wording differs on such a bridge.
Tests
packages/runtime/src/action-confirmation-handoff-33690.test.ts, new describe[#34325](7 cases), run through the real bridge for both tools. With the stdio door, the message carries the client sentence followed by the in-app clause. With no door (HTTP), it carries the in-app clause and never the client sentence.detailsare equal on both doors. The flag never reaches the service's hand-off.packages/mcp/src/mcp-action-confirmation-handoff-33690.test.ts, new describe[#34325](6 cases), for both tools:elicitation: the bridge gets no door and exactly{ elicitsCapableClients: true }as the fourth argument;initializethat advertisedelicitation: no door, two arguments.door: undefined, argCount: 2on stdio. The door is stillundefined; the pin now also readsfacts: { elicitsCapableClients: true }andargCount: 4. The intent is the same: the client is never asked and the call is handed off. The Streamable HTTP pin is unchanged.scripts/ablation-replace.mjs: each anchor went from 1 hit to 0, and each restore left the blob equal to HEAD with an emptygit diff HEAD. The tests import source through relative paths, so no dist rebuild is on the path. All 7 went red:confirmAdmittedActionstops passing it: runtime stdiorun_actionred.resume_runred.actionCallDoorFornever returns the facts: mcp stdio x3 red (one existing pin and two new ones).initialize: mcp HTTP x3 red (the existing MCP transport: server-to-client elicitation mid-call, so supporting clients confirm in place (UX upgrade over the email hold) #33712 HTTP pin and two new ones).Acceptance notes
elicitationits refusal keeps the old wording until it readsfacts. carrier: cloud (if cloud implements that bridge).packages/spec/src/contracts/ai-service.ts) still describes one message with both routes. The HTTP door's omission of the client route follows ruling 6909391261. The prose is left as it is.Verification
Two-minute check:
pnpm --filter @objectstack/runtime exec vitest run src/action-confirmation-handoff-33690.test.ts -t 34325. Expect 7 passing, includingstdio, a client without elicitation (run_action)andStreamable HTTP, no door (run_action).Readings at fa794d0:
build, typecheck, vitest (under os-verify-lock)
pnpm --filter '@objectstack/runtime^...' --filter '@objectstack/mcp^...' build && mcp typecheck && runtime typecheck && both pin files: VERDICT command-exit 0 (pins 53/53 and 34/34).pnpm --filter @objectstack/mcp test: MCP_EXIT=0, Test Files 85 passed (85), Tests 1515 passed (1515).pnpm --filter @objectstack/runtime test: RUNTIME_EXIT=0, Test Files 649 passed (649), Tests 12034 passed, 25 skipped (12059).derived gate families
dispatch-gates --commands --repo objectstack-ai/objectstack: 69 families.check-adr-0087-registrationandcheck-changeset-no-majoron theyes (widening)changeset.check:dual-build-cjs-loadsexit 3 (PREREQUISITE NOT MET: no whole-repo dist), so it is NOT MEASURED locally and left to CI.--ranwith exit codes: 69 derived, 68 run, 1 NOT-MEASURED, 0 UNRUN (exit 0).overlap-check: clean against origin/main 98bda0a. No merge of main was needed: main's 4 new commits do not touchpackages/mcporpackages/runtime.🤖 Generated with Claude Code
https://claude.ai/code/session_01QSeKYo86w1wqy2z2fMrryr